package com.company;

public class Circle extends Shape{
    private double radius;

    public Circle() {
    }

    public Circle(double radius, String color) {
        super(color);
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI * (radius * radius);
    }

    @Override
    public double getPer() {
        return 2*radius*Math.PI;
    }

    @Override
    public void showAll() {
        System.out.println("圆形半径：" + radius);
        System.out.println("圆形面积：" + getArea() + "\t圆形周长：" + getPer());
        System.out.println("圆形颜色为：" + getColor());
    }
}
